path_max
authorDebian X Strike Force <debian-x@lists.debian.org>
Fri, 13 Feb 2026 08:18:12 +0000 (10:18 +0200)
committerTimo Aaltonen <tjaalton@debian.org>
Fri, 13 Feb 2026 08:18:12 +0000 (10:18 +0200)
Gbp-Pq: Name path_max.diff

src/util/tests/cache_test.cpp
src/util/tests/process_test.c

index 5779fba3cb57b7215ec623537c08a2f4d8bc866b..f0efb94ae69b0553512a22f439e812157c82b021 100644 (file)
@@ -89,8 +89,8 @@ check_directories_created(void *mem_ctx, const char *cache_dir)
 {
    bool sub_dirs_created = false;
 
-   char buf[PATH_MAX];
-   if (getcwd(buf, PATH_MAX)) {
+   char *buf = getcwd(NULL, 0);
+   if (buf) {
       char *full_path = ralloc_asprintf(mem_ctx, "%s%s", buf, ++cache_dir);
       struct stat sb;
       if (stat(full_path, &sb) != -1 && S_ISDIR(sb.st_mode))
index fbbc7aff7296dda4e44a779ecc72f8df3656fd1b..11e5286cbcad02ad54f77ef5e8adb5d2594fad13 100644 (file)
 #define PATH_MAX MAX_PATH
 #endif
 
+#if !defined(PATH_MAX) && defined(__GNU__)
+#define PATH_MAX (4096)
+#endif
+
 static bool error = false;
 
 static void